﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Icoders.MarketTracker.Data.EF;
using Icoders.MarketTracker.Reports.Lib.Domain.Users;

namespace Icoders.MarketTracker.Reports.Lib.Repository.Users.Impl
{
    public class UserReportRepository : IUserReportRepository
    {
        private AppDataContext _ctx;

        public UserReportRepository(AppDataContext ctx)
        {
            _ctx = ctx;
        }

        public List<UserReport> GetAll()
        {
            return _ctx.TblUser
                .Select(s => new UserReport
                                 {
                                     FirstName=s.FirstName,
                                     LastName=s.LastName,
                                     Username=s.Username,
                                     Email = s.Email,
                                     MobileNo = s.MobileNo,
                                     CreatedOn = s.CreatedOn

                                 }).ToList();
        }
    }
}
